package com.chzc.fm.duotin.bean.home;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/6/24.
 */
public class RecommendData {

    private RecommendColumn column;
    /**
     * column : {}
     * data_list : []
     */

    private List<RecommendDataList> data_list;

    public static RecommendData objectFromData(String str) {

        return new Gson().fromJson(str, RecommendData.class);
    }

    public static List<RecommendData> arrayRecommendDataFromData(String str) {

        Type listType = new TypeToken<ArrayList<RecommendData>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public RecommendColumn getColumn() {
        return this.column;
    }

    public void setColumn(RecommendColumn column) {
        this.column = column;
    }

    public List<RecommendDataList> getData_list() {
        return data_list;
    }

    public void setData_list(List<RecommendDataList> data_list) {
        this.data_list = data_list;
    }

    public static class ColumnBean {
        public static ColumnBean objectFromData(String str) {

            return new Gson().fromJson(str, ColumnBean.class);
        }

        public static List<ColumnBean> arrayColumnBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<ColumnBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }
    }

    public class ColumnType{
        public static  final int COLUMN_BANNER = 6;
        public static  final int COLUMN_LANMU = 3;
        public static  final int COLUMN_TOPIC =1;
    }
}
